package org.imlinker.message;

import javax.swing.JOptionPane;

import org.imlinker.list.ListItem;
import org.imlinker.list.ViewList; 

/**
 * The item of message which used to add to messagelist.
 * 
 *
 */

public class MessageItem extends ListItem {

	/**
	 * The content of the messageItem.
	 */
	private String message;

	/**
	 * 
	 * @param tempContent
	 *            The messageItem's content.
	 * @param title
	 *            The messageItem's title.
	 */
	public MessageItem(final String tempContent, final String title) {
		this.message = tempContent;

		this.setTitle(title);
		this.setTipText(message);
	}

	public MessageItem(String title) { 
	}

	/**
	 * The double click.
	 */
	public void doubleClick() {
		JOptionPane.showMessageDialog(null, message, getTitle(),
				JOptionPane.OK_OPTION);
		ViewList.removeMessage(this);
	}

}
